itoa
This crate provides fast functions for printing integer primitives to an
io::Write
or a fmt::Write
. The implementation comes straight from
libcore but avoids the performance penalty of going through
fmt::Formatter
.
See also dtoa
for printing floating point primitives.
Version requirement: rustc 1.0+
[]
= "0.4"
Performance (lower is better)
Examples
use ;
The function signatures are:
;
;
where itoa::Integer
is implemented for i8, u8, i16, u16, i32, u32, i64, u64,
i128, u128, isize and usize. 128-bit integer support requires rustc 1.26+ and
the i128
feature of this crate enabled.
The write
function is only available when the std
feature is enabled
(default is enabled). The return value gives the number of bytes written.